package com.zmwx.auth.application.enums;

import lombok.Getter;

/**
 * 状态枚举
 */
@Getter
public enum AuthUserStateEnum {
    OPEN(0, "启用"),
    CLOSE(1, "禁用");
    private int code;
    private String desc;//状态中文

    AuthUserStateEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;

    }

    public static AuthUserStateEnum getByCode(int code) {
        for (AuthUserStateEnum resultCode : AuthUserStateEnum.values()) {
            if (resultCode.getCode() == code) {
                return resultCode;
            }
    }
        return null;
    }
}
